php sum array of objects

38

$sum = 0;
foreach($arrObj as $key=>$value){
  if(isset($value->commission))
     $sum += $value->commission;
}
echo $sum;

Comments

Submit
0 Comments